const state = { // 全局参数的初始状态
	//用户登录的用户名
	userName: '',
	//用户的token 
	accessToken:'',
	//webSocket推送的运输订单信息
	messageContent: null,
	//webSocket推送的退货订单信息
	outMessageContent: null,
	//webSocket推送的排队信息
	queueMessageContent:null,
	//接收sso请求到的目录
	munuList:[]
}
const mutations = {
	SET_USERNAME(state, val) {
		state.userName = val;
	},
	SET_MESSAGECONTENT(state, val) {
		state.messageContent = val;
	},
	SET_OUTMESSAGECONTENT(state, val) {
		state.outMessageContent = val;
	},
	SET_ACCESSTOKEN(state, val) {
		state.accessToken = val;
	},
	SET_QUEUEMESSAGECONTENT(state, val) {
		state.queueMessageContent = val;
	},
	SET_MUNU(state,val){
		state.munuList = val;
	}
}
const getters = {
	GET_USERNAME(state) {
		return state.userName;
	},
	GET_MESSAGECONTENT(state) {
		return state.messageContent;
	},
	GET_OUTMESSAGECONTENT(state) {
		return state.outMessageContent;
	},
	GET_ACCESSTOKEN(state) {
		return state.accessToken;
	},
	GET_QUEUEMESSAGECONTENT(state) {
		return state.queueMessageContent;
	},
	GET_MUNULIST(state) {
		return state.munuList
	}

}
const actions = {
	setUserName({commit}, val) {
		commit('SET_USERNAME', val)
	},
	setMessageContent({commit}, val) {
		commit('SET_MESSAGECONTENT', val)
	},
	setOutMessageContent({commit}, val) {
		commit('SET_OUTMESSAGECONTENT', val)
	},
	setAccessToken({commit}, val) {
		commit('SET_ACCESSTOKEN', val)
	},
	setQueueMessageContent({commit}, val) {
		commit('SET_QUEUEMESSAGECONTENT', val)
	},
	setMenuList({commit},val) {
		commit('SET_MUNU',val)
	}
}
export default {
	state,
	getters,
	mutations,
	actions
}
